package com.fast.develop.meta.base.resource;

import java.io.InputStream;
import java.util.*;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

/**
 * @author 莫寅
 * @createTime 2022-06-25 00:22
 * @desc：
 */
public interface MultResource<T extends Resource> extends Iterable<T> {



    @Override
    default Iterator<T> iterator() {
        return Arrays.asList(getResources()).iterator();
    }

    default Stream<T> stream() {
        return StreamSupport.stream(spliterator(), false);
    }


    @Override
    default Spliterator<T> spliterator() {
        return Spliterators.spliterator(getResources(), 0);
    }


    public T[] getResources();

    public List<InputStream> getInputStreams();

    public void reload();
}
